#if !defined(AFX_EJANNOVIEW_H__0A42E10C_0E10_4BFA_8F0F_44833B9A0AE4__INCLUDED_)
#define AFX_EJANNOVIEW_H__0A42E10C_0E10_4BFA_8F0F_44833B9A0AE4__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// EJAnnoView.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CEJAnnoView view

#define OPER_NONE		0
#define OPER_ADD		1
#define OPER_MOVE		2
#define OPER_RESIZE		3

class CEJAnnoView : public CView
{
protected:
	CEJAnnoView();           // protected constructor used by dynamic creation
	DECLARE_DYNCREATE(CEJAnnoView)

// Attributes
public:

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CEJAnnoView)
	public:
	virtual void OnInitialUpdate();
	protected:
	virtual void OnDraw(CDC* pDC);      // overridden to draw this view
	//}}AFX_VIRTUAL

// Implementation
protected:
	virtual ~CEJAnnoView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

	// Generated message map functions
protected:
	//{{AFX_MSG(CEJAnnoView)
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
	afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
	afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

public:
	CFont		m_font;
//	HBITMAP bitmap;
    BITMAPINFO	m_bmi;
    BYTE*		m_bmp;
	DWORD		m_dwImageLength;
	
	void Refresh();

	CRect		m_rcDisp;
	void DrawImage(CDC* pDC);
	void DrawAnnos(CDC* pDC);
	void DrawAnno(CDC* pDC,CEJPage& page,WORD index,CEJAnno& anno,COLORREF c1,COLORREF c2);

	void DrawFocus(CDC* pDC);

	BYTE		m_nHover;
	BYTE		m_nOper;
	BYTE		m_nOperAnno;
	BYTE		m_nOperGrip;
	BOOL		m_bHasFocus;
	CRect		m_rcFocus;
	BOOL		m_bPressed;
	CPoint		m_ptPressed;
	CPoint		m_ptDrag;

//	void OnSetAnno(WORD index,const CRect& rc);

	void OnHover(CDC* pDC,const CPoint& pt);

	void OnBeginAdd();
	void OnDuringAdd(const CPoint& pt);
	void OnEndAdd();

	void OnBeginSelect(WORD index,BYTE gripIndex);
	void OnDuringMove(const CPoint& pt);
	void OnDuringResize(const CPoint& pt);
	void OnEndSelect(const CPoint& pt);
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_EJANNOVIEW_H__0A42E10C_0E10_4BFA_8F0F_44833B9A0AE4__INCLUDED_)
